﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using System.Runtime.InteropServices;

namespace ScenarioFramework.WAPI
{
    public partial class User
    {
        /// <summary>
        /// Authenticates the specified s user key.
        /// </summary>
        /// <param name="sUserKey">The s user key.</param>
        /// <param name="sPassword">The s password.</param>
        /// <param name="response">The response.</param>
        /// <returns></returns>
        [DllImport("WAPI.Dll", EntryPoint = "authenticate")]
        private static extern int Authenticate(String sUserKey, String sPassword, ref Response response);

        /// <summary>
        /// Determines whether [is in role] [the specified s user key].
        /// </summary>
        /// <param name="sUserKey">The s user key.</param>
        /// <param name="sRole">The s role.</param>
        /// <param name="response">The response.</param>
        /// <returns></returns>
        [DllImport("WAPI.Dll", EntryPoint = "isInRole")]
        private static extern int IsInRole(String sUserKey, String sRole, ref Response response);

        /// <summary>
        /// Gets the user.
        /// </summary>
        /// <param name="sUserKey">The s user key.</param>
        /// <param name="response">The response.</param>
        /// <returns></returns>
        [DllImport("WAPI.Dll", EntryPoint = "getUser")]
        private static extern String GetUser(String sUserKey, ref Response response);

        /// <summary>
        /// Gets the users.
        /// </summary>
        /// <param name="response">The response.</param>
        /// <returns></returns>
        [DllImport("WAPI.Dll", EntryPoint = "getUsers")]
        internal static extern String GetUsers(ref Response response);

        /// <summary>
        /// Gets the users by role.
        /// </summary>
        /// <param name="sRole">The s role.</param>
        /// <param name="response">The response.</param>
        /// <returns></returns>
        [DllImport("WAPI.Dll", EntryPoint = "getUsersByRole")]
        private static extern String GetUsersByRole(String sRole, ref Response response);

        /// <summary>
        /// Creates the user.
        /// </summary>
        /// <param name="sUser">The s user.</param>
        /// <param name="response">The response.</param>
        [DllImport("WAPI.Dll", EntryPoint = "createUser")]
        private static extern void CreateUser(String sUser, ref Response response);

        /// <summary>
        /// Updates the user.
        /// </summary>
        /// <param name="sUser">The s user.</param>
        /// <param name="response">The response.</param>
        [DllImport("WAPI.Dll", EntryPoint = "updateUser")]
        private static extern void UpdateUser(String sUser, ref Response response);

        /// <summary>
        /// Deletes the user.
        /// </summary>
        /// <param name="sUserKey">The s user key.</param>
        /// <param name="response">The response.</param>
        [DllImport("WAPI.Dll", EntryPoint = "deleteUser")]
        private static extern void DeleteUser(String sUserKey, ref Response response);
    }
}
